define(['durandal/activator','knockout','./sidebar/index','./doc-model/index'], function(activator,ko,sidebar,docModel) {
	
	var screen = {
		content: activator.create(),
		sidebar: ko.observable(),
		openDocument: function(docModel) {
			this.content.activateItem(docModel)
		},
		closeDocument: function() {
			this.content.activateItem(null)
		},
		showEditor: function(editorModel) {
			this.sidebar(editorModel);
		},
		hideEditor: function() {
			this.sidebar(null);
		}
	};
	
	
	return {
		screen:screen,
		openDocument:function () {
			debugger;
			screen.openDocument(docModel);
		},
		closeDocument:function () {
			screen.closeDocument();
		},
		showEditor:function () {
			screen.showEditor(sidebar);
		},
		hideEditor:function () {
			screen.hideEditor();
		},
		
	};
})